﻿using UnityEngine;
using System.Collections;


public class EnemyMoveController : MonoBehaviour {

	public bool left;
	public bool right;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {

	}

	void OnTriggerEnter2D(Collider2D target){
		if (target.gameObject.tag.Equals ("Enemy")) {
						if (left) {
								target.gameObject.GetComponent<Enemy> ().Turn ("right");
						}
						if (right) {
								target.gameObject.GetComponent<Enemy> ().Turn ("left");
						}
				}
	}
}
